<!doctype html>
<html lang="zh-cn">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>ECharts入门-简单柱状图示例</title>
 </head>
 <body>
	<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="myChart" style="height:400px"></div>
    <!-- ECharts单文件引入 -->
    <script src="http://echarts.baidu.com/build/dist/echarts-all.js"></script>
    <script type="text/javascript">
        // 基于准备好的dom，初始化echarts图表
        var myChart = echarts.init(document.getElementById('myChart')); 
        var option = {
			toolbox: {
					show : true,
					feature : {
					   saveAsImage : {show: true}
					}
			},
            tooltip: {
                show: true,
				trigger: 'item',
				formatter: "{b} 销量 : {c}"
            },
            legend: {
                data:['销量']
            },
            xAxis : [
                {
                    type : 'category',
                    data : ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
                }
            ],
            yAxis : [
                {
                    type : 'value'
                }
            ],
            series : [
                {
                    "name":"销量",
                    "type":"bar",
                    "data":[5, 20, 40, 10, 10, 20]
                }
            ]
        };
        // 为echarts对象加载数据 
        myChart.setOption(option); 
    </script>
    </script>
 </body>
</html>